3.201 \(\int \cot ^2(c+d x) (a+i a \tan (c+d x))^{2/3} (A+B \tan (c+d x)) \, dx\)

Optimal. Leaf size=342 \[ \frac{a^{2/3} (3 B+2 i A) \tan ^{-1}\left (\frac{\sqrt [3]{a}+2 \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt{3} \sqrt [3]{a}}\right )}{\sqrt{3} d}-\frac{\sqrt{3} a^{2/3} (B+i A) \tan ^{-1}\left (\frac{\sqrt [3]{a}+2^{2/3} \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt{3} \sqrt [3]{a}}\right )}{\sqrt [3]{2} d}-\frac{a^{2/3} (3 B+2 i A) \log (\tan (c+d x))}{6 d}+\frac{a^{2/3} (3 B+2 i A) \log \left (\sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 d}-\frac{3 a^{2/3} (B+i A) \log \left (\sqrt [3]{2} \sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 \sqrt [3]{2} d}-\frac{a^{2/3} (B+i A) \log (\cos (c+d x))}{2 \sqrt [3]{2} d}+\frac{a^{2/3} x (A-i B)}{2 \sqrt [3]{2}}-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d} \]

[Out]

(a^(2/3)*(A - I*B)*x)/(2*2^(1/3)) + (a^(2/3)*((2*I)*A + 3*B)*ArcTan[(a^(1/3) + 2*(a + I*a*Tan[c + d*x])^(1/3))
/(Sqrt[3]*a^(1/3))])/(Sqrt[3]*d) - (Sqrt[3]*a^(2/3)*(I*A + B)*ArcTan[(a^(1/3) + 2^(2/3)*(a + I*a*Tan[c + d*x])
^(1/3))/(Sqrt[3]*a^(1/3))])/(2^(1/3)*d) - (a^(2/3)*(I*A + B)*Log[Cos[c + d*x]])/(2*2^(1/3)*d) - (a^(2/3)*((2*I
)*A + 3*B)*Log[Tan[c + d*x]])/(6*d) + (a^(2/3)*((2*I)*A + 3*B)*Log[a^(1/3) - (a + I*a*Tan[c + d*x])^(1/3)])/(2
*d) - (3*a^(2/3)*(I*A + B)*Log[2^(1/3)*a^(1/3) - (a + I*a*Tan[c + d*x])^(1/3)])/(2*2^(1/3)*d) - (A*Cot[c + d*x
]*(a + I*a*Tan[c + d*x])^(2/3))/d

________________________________________________________________________________________

Rubi [A]  time = 0.590007, antiderivative size = 342, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 8, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222, Rules used = {3598, 3600, 3481, 55, 617, 204, 31, 3599} \[ \frac{a^{2/3} (3 B+2 i A) \tan ^{-1}\left (\frac{\sqrt [3]{a}+2 \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt{3} \sqrt [3]{a}}\right )}{\sqrt{3} d}-\frac{\sqrt{3} a^{2/3} (B+i A) \tan ^{-1}\left (\frac{\sqrt [3]{a}+2^{2/3} \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt{3} \sqrt [3]{a}}\right )}{\sqrt [3]{2} d}-\frac{a^{2/3} (3 B+2 i A) \log (\tan (c+d x))}{6 d}+\frac{a^{2/3} (3 B+2 i A) \log \left (\sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 d}-\frac{3 a^{2/3} (B+i A) \log \left (\sqrt [3]{2} \sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 \sqrt [3]{2} d}-\frac{a^{2/3} (B+i A) \log (\cos (c+d x))}{2 \sqrt [3]{2} d}+\frac{a^{2/3} x (A-i B)}{2 \sqrt [3]{2}}-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^(2/3)*(A + B*Tan[c + d*x]),x]

[Out]

(a^(2/3)*(A - I*B)*x)/(2*2^(1/3)) + (a^(2/3)*((2*I)*A + 3*B)*ArcTan[(a^(1/3) + 2*(a + I*a*Tan[c + d*x])^(1/3))
/(Sqrt[3]*a^(1/3))])/(Sqrt[3]*d) - (Sqrt[3]*a^(2/3)*(I*A + B)*ArcTan[(a^(1/3) + 2^(2/3)*(a + I*a*Tan[c + d*x])
^(1/3))/(Sqrt[3]*a^(1/3))])/(2^(1/3)*d) - (a^(2/3)*(I*A + B)*Log[Cos[c + d*x]])/(2*2^(1/3)*d) - (a^(2/3)*((2*I
)*A + 3*B)*Log[Tan[c + d*x]])/(6*d) + (a^(2/3)*((2*I)*A + 3*B)*Log[a^(1/3) - (a + I*a*Tan[c + d*x])^(1/3)])/(2
*d) - (3*a^(2/3)*(I*A + B)*Log[2^(1/3)*a^(1/3) - (a + I*a*Tan[c + d*x])^(1/3)])/(2*2^(1/3)*d) - (A*Cot[c + d*x
]*(a + I*a*Tan[c + d*x])^(2/3))/d

Rule 3598

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[((A*d - B*c)*(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1))/(f
*(n + 1)*(c^2 + d^2)), x] - Dist[1/(a*(n + 1)*(c^2 + d^2)), Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n
 + 1)*Simp[A*(b*d*m - a*c*(n + 1)) - B*(b*c*m + a*d*(n + 1)) - a*(B*c - A*d)*(m + n + 1)*Tan[e + f*x], x], x],
 x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[n, -1]

Rule 3600

Int[(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)]))/((c_.) + (d_.)*tan[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[(A*b + a*B)/(b*c + a*d), Int[(a + b*Tan[e + f*x])^m, x], x] - Dist[(B*c
 - A*d)/(b*c + a*d), Int[((a + b*Tan[e + f*x])^m*(a - b*Tan[e + f*x]))/(c + d*Tan[e + f*x]), x], x] /; FreeQ[{
a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[A*b + a*B, 0]

Rule 3481

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Dist[b/d, Subst[Int[(a + x)^(n - 1)/(a - x), x]
, x, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[a^2 + b^2, 0]

Rule 55

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(1/3)), x_Symbol] :> With[{q = Rt[(b*c - a*d)/b, 3]}, -Simp[L
og[RemoveContent[a + b*x, x]]/(2*b*q), x] + (Dist[3/(2*b), Subst[Int[1/(q^2 + q*x + x^2), x], x, (c + d*x)^(1/
3)], x] - Dist[3/(2*b*q), Subst[Int[1/(q - x), x], x, (c + d*x)^(1/3)], x])] /; FreeQ[{a, b, c, d}, x] && PosQ
[(b*c - a*d)/b]

Rule 617

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[(a*c)/b^2]}, Dist[-2/b, Sub
st[Int[1/(q - x^2), x], x, 1 + (2*c*x)/b], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 3599

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(b*B)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^n, x], x, Tan[e + f*x
]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && EqQ[A*b + a*B,
 0]

Rubi steps

\begin{align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^{2/3} (A+B \tan (c+d x)) \, dx &=-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d}+\frac{\int \cot (c+d x) (a+i a \tan (c+d x))^{2/3} \left (\frac{1}{3} a (2 i A+3 B)-\frac{1}{3} a A \tan (c+d x)\right ) \, dx}{a}\\ &=-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d}+(-A+i B) \int (a+i a \tan (c+d x))^{2/3} \, dx+\frac{(2 i A+3 B) \int \cot (c+d x) (a-i a \tan (c+d x)) (a+i a \tan (c+d x))^{2/3} \, dx}{3 a}\\ &=-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d}+\frac{(a (i A+B)) \operatorname{Subst}\left (\int \frac{1}{(a-x) \sqrt [3]{a+x}} \, dx,x,i a \tan (c+d x)\right )}{d}+\frac{(a (2 i A+3 B)) \operatorname{Subst}\left (\int \frac{1}{x \sqrt [3]{a+i a x}} \, dx,x,\tan (c+d x)\right )}{3 d}\\ &=\frac{a^{2/3} (A-i B) x}{2 \sqrt [3]{2}}-\frac{a^{2/3} (i A+B) \log (\cos (c+d x))}{2 \sqrt [3]{2} d}-\frac{a^{2/3} (2 i A+3 B) \log (\tan (c+d x))}{6 d}-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d}+\frac{\left (3 a^{2/3} (i A+B)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt [3]{2} \sqrt [3]{a}-x} \, dx,x,\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 \sqrt [3]{2} d}-\frac{(3 a (i A+B)) \operatorname{Subst}\left (\int \frac{1}{2^{2/3} a^{2/3}+\sqrt [3]{2} \sqrt [3]{a} x+x^2} \, dx,x,\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 d}-\frac{\left (a^{2/3} (2 i A+3 B)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt [3]{a}-x} \, dx,x,\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 d}+\frac{(a (2 i A+3 B)) \operatorname{Subst}\left (\int \frac{1}{a^{2/3}+\sqrt [3]{a} x+x^2} \, dx,x,\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 d}\\ &=\frac{a^{2/3} (A-i B) x}{2 \sqrt [3]{2}}-\frac{a^{2/3} (i A+B) \log (\cos (c+d x))}{2 \sqrt [3]{2} d}-\frac{a^{2/3} (2 i A+3 B) \log (\tan (c+d x))}{6 d}+\frac{a^{2/3} (2 i A+3 B) \log \left (\sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 d}-\frac{3 a^{2/3} (i A+B) \log \left (\sqrt [3]{2} \sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 \sqrt [3]{2} d}-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d}+\frac{\left (3 a^{2/3} (i A+B)\right ) \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,1+\frac{2^{2/3} \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt [3]{a}}\right )}{\sqrt [3]{2} d}-\frac{\left (a^{2/3} (2 i A+3 B)\right ) \operatorname{Subst}\left (\int \frac{1}{-3-x^2} \, dx,x,1+\frac{2 \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt [3]{a}}\right )}{d}\\ &=\frac{a^{2/3} (A-i B) x}{2 \sqrt [3]{2}}+\frac{a^{2/3} (2 i A+3 B) \tan ^{-1}\left (\frac{1+\frac{2 \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt [3]{a}}}{\sqrt{3}}\right )}{\sqrt{3} d}-\frac{\sqrt{3} a^{2/3} (i A+B) \tan ^{-1}\left (\frac{1+\frac{2^{2/3} \sqrt [3]{a+i a \tan (c+d x)}}{\sqrt [3]{a}}}{\sqrt{3}}\right )}{\sqrt [3]{2} d}-\frac{a^{2/3} (i A+B) \log (\cos (c+d x))}{2 \sqrt [3]{2} d}-\frac{a^{2/3} (2 i A+3 B) \log (\tan (c+d x))}{6 d}+\frac{a^{2/3} (2 i A+3 B) \log \left (\sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 d}-\frac{3 a^{2/3} (i A+B) \log \left (\sqrt [3]{2} \sqrt [3]{a}-\sqrt [3]{a+i a \tan (c+d x)}\right )}{2 \sqrt [3]{2} d}-\frac{A \cot (c+d x) (a+i a \tan (c+d x))^{2/3}}{d}\\ \end{align*}

Mathematica [F]  time = 6.24911, size = 0, normalized size = 0. \[ \int \cot ^2(c+d x) (a+i a \tan (c+d x))^{2/3} (A+B \tan (c+d x)) \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^(2/3)*(A + B*Tan[c + d*x]),x]

[Out]

Integrate[Cot[c + d*x]^2*(a + I*a*Tan[c + d*x])^(2/3)*(A + B*Tan[c + d*x]), x]

________________________________________________________________________________________

Maple [F]  time = 0.211, size = 0, normalized size = 0. \begin{align*} \int \left ( \cot \left ( dx+c \right ) \right ) ^{2} \left ( a+ia\tan \left ( dx+c \right ) \right ) ^{{\frac{2}{3}}} \left ( A+B\tan \left ( dx+c \right ) \right ) \, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(2/3)*(A+B*tan(d*x+c)),x)

[Out]

int(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(2/3)*(A+B*tan(d*x+c)),x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(2/3)*(A+B*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.00936, size = 2824, normalized size = 8.26 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(2/3)*(A+B*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/6*(3*2^(2/3)*(-2*I*A*e^(2*I*d*x + 2*I*c) - 2*I*A)*(a/(e^(2*I*d*x + 2*I*c) + 1))^(2/3)*e^(4/3*I*d*x + 4/3*I*c
) + 6*(1/2)^(1/3)*(d*e^(2*I*d*x + 2*I*c) - d)*((I*A^3 + 3*A^2*B - 3*I*A*B^2 - B^3)*a^2/d^3)^(1/3)*log((2^(1/3)
*(A^2 - 2*I*A*B - B^2)*a*(a/(e^(2*I*d*x + 2*I*c) + 1))^(1/3)*e^(2/3*I*d*x + 2/3*I*c) + 2*(1/2)^(2/3)*d^2*((I*A
^3 + 3*A^2*B - 3*I*A*B^2 - B^3)*a^2/d^3)^(2/3))/((A^2 - 2*I*A*B - B^2)*a)) + 3*(1/2)^(1/3)*((I*sqrt(3)*d - d)*
e^(2*I*d*x + 2*I*c) - I*sqrt(3)*d + d)*((I*A^3 + 3*A^2*B - 3*I*A*B^2 - B^3)*a^2/d^3)^(1/3)*log((2^(1/3)*(A^2 -
 2*I*A*B - B^2)*a*(a/(e^(2*I*d*x + 2*I*c) + 1))^(1/3)*e^(2/3*I*d*x + 2/3*I*c) - (1/2)^(2/3)*(I*sqrt(3)*d^2 + d
^2)*((I*A^3 + 3*A^2*B - 3*I*A*B^2 - B^3)*a^2/d^3)^(2/3))/((A^2 - 2*I*A*B - B^2)*a)) + 3*(1/2)^(1/3)*((-I*sqrt(
3)*d - d)*e^(2*I*d*x + 2*I*c) + I*sqrt(3)*d + d)*((I*A^3 + 3*A^2*B - 3*I*A*B^2 - B^3)*a^2/d^3)^(1/3)*log((2^(1
/3)*(A^2 - 2*I*A*B - B^2)*a*(a/(e^(2*I*d*x + 2*I*c) + 1))^(1/3)*e^(2/3*I*d*x + 2/3*I*c) - (1/2)^(2/3)*(-I*sqrt
(3)*d^2 + d^2)*((I*A^3 + 3*A^2*B - 3*I*A*B^2 - B^3)*a^2/d^3)^(2/3))/((A^2 - 2*I*A*B - B^2)*a)) + ((-I*sqrt(3)*
d - d)*e^(2*I*d*x + 2*I*c) + I*sqrt(3)*d + d)*((-8*I*A^3 - 36*A^2*B + 54*I*A*B^2 + 27*B^3)*a^2/d^3)^(1/3)*log(
(2^(1/3)*(8*A^2 - 24*I*A*B - 18*B^2)*a*(a/(e^(2*I*d*x + 2*I*c) + 1))^(1/3)*e^(2/3*I*d*x + 2/3*I*c) + (I*sqrt(3
)*d^2 - d^2)*((-8*I*A^3 - 36*A^2*B + 54*I*A*B^2 + 27*B^3)*a^2/d^3)^(2/3))/((8*A^2 - 24*I*A*B - 18*B^2)*a)) + (
(I*sqrt(3)*d - d)*e^(2*I*d*x + 2*I*c) - I*sqrt(3)*d + d)*((-8*I*A^3 - 36*A^2*B + 54*I*A*B^2 + 27*B^3)*a^2/d^3)
^(1/3)*log((2^(1/3)*(8*A^2 - 24*I*A*B - 18*B^2)*a*(a/(e^(2*I*d*x + 2*I*c) + 1))^(1/3)*e^(2/3*I*d*x + 2/3*I*c)
+ (-I*sqrt(3)*d^2 - d^2)*((-8*I*A^3 - 36*A^2*B + 54*I*A*B^2 + 27*B^3)*a^2/d^3)^(2/3))/((8*A^2 - 24*I*A*B - 18*
B^2)*a)) + 2*(d*e^(2*I*d*x + 2*I*c) - d)*((-8*I*A^3 - 36*A^2*B + 54*I*A*B^2 + 27*B^3)*a^2/d^3)^(1/3)*log((2^(1
/3)*(4*A^2 - 12*I*A*B - 9*B^2)*a*(a/(e^(2*I*d*x + 2*I*c) + 1))^(1/3)*e^(2/3*I*d*x + 2/3*I*c) + d^2*((-8*I*A^3
- 36*A^2*B + 54*I*A*B^2 + 27*B^3)*a^2/d^3)^(2/3))/((4*A^2 - 12*I*A*B - 9*B^2)*a)))/(d*e^(2*I*d*x + 2*I*c) - d)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**2*(a+I*a*tan(d*x+c))**(2/3)*(A+B*tan(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac{2}{3}} \cot \left (d x + c\right )^{2}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^2*(a+I*a*tan(d*x+c))^(2/3)*(A+B*tan(d*x+c)),x, algorithm="giac")

[Out]

integrate((B*tan(d*x + c) + A)*(I*a*tan(d*x + c) + a)^(2/3)*cot(d*x + c)^2, x)